/**
 * @file MainForm
 *
 * @brief 
 *
 * @author gyzheng
 *
 * @mail gyazheng@gmail.com
 *
 * @date 07/27/2011 22:37:51 
 *
 */

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using CarFrameWork.Model;
using CarFrameWork.UI.Common;

namespace CarFrameWork.UI.SystemManage.GroupMangage
{
    public partial class GroupFormBase : DetailForm
    {
        protected GroupInfo m_GroupInfo;
        public GroupFormBase()
        {
            InitializeComponent();
        }

        private bool InspectionText(TextBox text)
        {
            if (string.Empty == text.Text.Trim())
                return false;
            return true;
        }

        protected bool TestContent()
        {
            if (!InspectionText(this.txtGroupName))
                return false;
            if (!InspectionText(this.txtStep))
                return false;
            if (!InspectionText(this.txtDescript))
                return false;
            return true;
        }

        protected void SetUserToForm()
        {
            txtgroubId.Text = m_GroupInfo.ID.ToString() ;
            txtGroupName.Text = m_GroupInfo.GroupName;
            txtStep.Text = m_GroupInfo.SetpNum.ToString();
            txtDescript.Text = m_GroupInfo.Description;
        }

        protected void GetFormToUser()
        {
            m_GroupInfo.GroupName = txtGroupName.Text;
            m_GroupInfo.SetpNum = Convert.ToInt32(txtStep.Text);
            m_GroupInfo.Description = txtDescript.Text;
        }

        private void quitBtn_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}